from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # 点击搜索框
    # ANDROID_UIAUTOMATOR 定位
    def sou(self):
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.RelativeLayout").instance(3)')
        ele = self.find_ele(loc)
        return ele

    # 输入商品
    # CLASS_NAME 定位
    def shu(self):
        loc = (By.CLASS_NAME,'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele

    # 点击搜索按钮
    # ID 定位
    def an(self):
        loc = (By.ID,'com.achievo.vipshop:id/tv_search')
        ele = self.find_ele(loc)
        return ele

